package com.lyun.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lyun.mapper.LoveValueMapper;
import com.lyun.pojo.LoveValue;
import com.lyun.pojo.User;
import com.lyun.service.LoveValueService;
import com.lyun.vo.VisitorsVo;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;

@DubboService
public class LoveValueServiceImpl extends ServiceImpl<LoveValueMapper, LoveValue> implements LoveValueService {

    @Resource
    private LoveValueMapper loveValueMapper;

    @Override
    public boolean insertValue(LoveValue loveValue) {
        return loveValueMapper.insertValue(loveValue) > 0;
    }

    @Override
    public LoveValue selectValueByFromIdAndToId(Long fromId, Long toId) {
        return loveValueMapper.selectValue(fromId, toId);
    }

    @Override
    public Integer selectFateValueByFromIdAndToId(Long fromId, Long toId) {
        return loveValueMapper.selectFateValue(fromId, toId);
    }

}
